package com.punai.common.utils.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class IsConverter implements Converter<String> {

    @Override
    public WriteCellData<String> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        String result;
        if ("Y".equals(value)) {
            result = "是";
        } else if ("N".equals(value)) {
            result = "否";
        } else {
            result =  "";
        }
        return new WriteCellData<>(result);
    }
}
